import { createApp } from 'vue'
import App from './App.vue'
import router from './router/router'
// 导入ElementPlus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import 'reset-css'
import {createPinia} from 'pinia'
import piniaPersist from 'pinia-plugin-persist'
// 1. 导入 图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import './assets/style/layout.css'
import Head from './components/Head.vue'

const app = createApp(App)

const pinia = createPinia()

// 注册路由
app.use(router)
app.use(pinia)
pinia.use(piniaPersist)
app.use(ElementPlus)

// 2. 把所有图标 都注册成 全局组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
app.component('Head',Head)

app.mount('#app')
